<%@ page language="java" import="java.util.*" pageEncoding="utf-8" import="java.sql.*"%>
<%@ include file="/base/base.jsp"%>
<%@ include file="/base/database.jsp"%>
	<%
		request.setCharacterEncoding("utf-8");
		
		String depID=request.getParameter("depID");
		String depName=request.getParameter("depName");
		System.out.println(depName);
		System.out.println(depID);

		StringBuffer sqlBuff=new StringBuffer();
		sqlBuff.append("update sys_department set depName=? where depID=?");
		String sql=sqlBuff.toString();
		
		Connection conn=getConn();
		PreparedStatement pstmt=conn.prepareStatement(sql);
		
		int parameterIndex=1;
		
		pstmt.setNString(parameterIndex++,depName);
		pstmt.setString(parameterIndex++,depID);
		int c=pstmt.executeUpdate();
		 
		if(pstmt!=null){
			pstmt.close();
		}
		if(conn!=null){
			conn.close();
		}
		
		process(request,response,"department_list.jsp");
	%>